package com.lmk.ms.common.dto.es;

import com.lmk.ms.common.dto.db.Sort;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * ES搜索参数
 * @author laomake@hotmail.com
 * @version 1.0
 * @date 2023/9/8
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class EsSearchParameter {

    @Schema(description = "搜索条件")
    private List<EsFieldSearchParameter> searchList;

    @Schema(description = "排序条件")
    private List<Sort> sortList;

    @Schema(description = "页码")
    private Integer page = 1;

    @Schema(description = "容量")
    private Integer size = 20;

    public EsSearchParameter(Integer page, Integer size) {
        this.page = page;
        this.size = size;
    }
}
